<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="../../favicon.ico" rel="shortcut icon" />
<link href="../../base.css" rel="stylesheet" type="text/css" media="screen" />
<script src="../../jquery/jquery.js" type="text/javascript"></script>
<script src="../../event.drag/jquery.event.drag.js" type="text/javascript"></script>
<title>jquery.event.drag</title>
</head><body>

<a href="./">&laquo; Index</a>

<style type="text/css" media="screen">
.box {
	position: absolute;
	height: 98px;
	width: 98px;
	background: #CCF;
	border: 1px solid #AAD;
	cursor: move;
	}
</style>

<script type="text/javascript">
jQuery(function($){
	$('#dragdemo')
		.drag(function( ev, dd ){
			$( this ).css( 
				ev.shiftKey ? 
				{ top: dd.offsetY } : 
				{ left: dd.offsetX }
				);
			});
	});
</script>

<h2>event.drag / axis</h2>

<div class="box" id="dragdemo"></div>

</body></html>